<?php
/**
 * 
 * User Interface
 * This is meant to define the most basic User class that can be passed
 * to any class that requires it.
 * 
 * The Crossley Framework prmary user class adapts this interface to
 * athorities for Identity (confirm()) and Permission (isPermitted())
 * 
 * The idea here is that the user object you created knows how to Authorize and Authenticate
 * 
 * @author Alton Crossley <crossleyframework@nogahidebootstrap.com>
 * @package Crossley Framework
 *  
 * @copyright Copyright (c) 2003-2009, Nogaide BootStrap INC. All rights reserved.
 * @license BSD http://opensource.org/licenses/bsd-license.php
 * @version $Id:$
 * 
 */
interface X_User_Interface
{
    /**
     * get the username
     * @return string
     */
    public function getName();
    /**
     * set the username
     */
    public function setName($sName);
    /**
     * get a print friendly name
     * @return string
     */
    public function getPrintableName();
    /**
     * set a print friendly name
     */
    public function setPrintableName($sPrintableName);
    /**
     * used to get unique id from Authority
     *
     * @return string
     */
    public function getUid();
    /**
     * used to set user identity
     * 
     * @return X_User_Interface refrence to current instance
     */
    public function setUid($xId);
    /**
     * confirm the current identity is logged in.
     * return false if no id is set.
     *
     * @return bool
     */
    public function confirm();
    /**
     * this method knows how to login the user (identify/authenticate)
     * ex. forward to a login page
     * 
     * @return void
     */
    public function identify();
    /**
     * used to check
     *
     * @param string $sSubjectUri
     * @param string $sDetail
     */
    public function isPermitted($sSubjectUri, $sDetail);
    /**
     * set the users email address
     * @param string $sEmailAddress
     */
    public function setEmail($sEmailAddress);
    /**
     * get the users email address
     * @return string
     */
    public function getEmail();
    /**
     * get the user profile information
     * @return array
     */
    public function getData();
    /**
     * set the user profile information
     * if required this should handle state
     * 
     * at minimum this method should take
     * array (
     *   'email' => string
     *   ,'name' => string
     *   ,'printable_name' => string
     *   ,'uid' => string
     *   ...
     * )
     * 
     * @param array $aData
     */
    public function setData(array $aData);
}